package cn.com.enersun.iec61850.web.redis;

import cn.com.enersun.iec61850.SampleApplication;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by lionel on 2017/8/18.
 */
@RunWith(value = SpringRunner.class)
@SpringBootTest(classes = SampleApplication.class)
public class RedisTest {
    @Autowired
    private RedisUtil redisUtil;

    @Test
    public void testRedisSet() throws Exception {
        Map<String, Object> map = new HashMap<>();
        map.put("1111", "1111");
        map.put("2222", "2222");
        redisUtil.set("testRedisSet2", map);
        Assert.assertEquals("liuxi", redisUtil.get("testRedisSet"));
    }
}
